package com.cn.lycss.service.impl;

import com.cn.lycss.dao.ProductDao;
import com.cn.lycss.dao.impl.ProductImpl;
import com.cn.lycss.model.ProductModel;
import com.cn.lycss.model.ResultModel;
import com.cn.lycss.service.ProductService;
import com.cn.lycss.util.Result;

import java.util.List;

public class ProductServiceImpl implements ProductService {
    @Override
    public ResultModel findAll(ProductModel model) {
//        ResultModel resultModel=new ResultModel();
        ProductDao productDao=new ProductImpl();
        List<ProductModel> list=productDao.findAll(model);
//        resultModel.setData(list);
//        resultModel.setCode(Result.SUCCESS_CODE);
        int count=productDao.getCount(model);
        return new ResultModel("",0,count,list);
    }

    @Override
    public ResultModel add(ProductModel model) {
        return null;
//        return ResultModel.getInstance(productDao.add(model));
    }

    @Override
    public ResultModel getCount(ProductModel productModel) {
        return null;
//        return ResultModel.getInstance(productDao.getCount(productModel));
    }

    @Override
    public ResultModel findById(ProductModel productModel) {
        return null;
//        return ResultModel.getInstance(productDao.findById(productModel));
    }

    @Override
    public ResultModel update(ProductModel model) {
        return null;
//        return ResultModel.getInstance(productDao.update(model));
    }

    @Override
    public ResultModel del(ProductModel productModel) {
        return null;
//        return ResultModel.getInstance(productDao.del(productModel));
    }

    @Override
    public ResultModel enable(ProductModel productModel) {
        return null;
//        return ResultModel.getInstance(productDao.enable(productModel));
    }
}
